﻿Imports DTO
Imports DAO
Public Class NhaCungCapBUS

    Public Shared Function LayDSNhaCungCapCbx() As DataTable
        Return NhaCungCapDAO.LayDSNhaCungCapCbx()
    End Function

    Public Shared Function LayDSNhaCungCap() As DataTable
        Return NhaCungCapDAO.LayDSNhaCungCap()
    End Function

    Public Shared Function ThemNhaCungCap(ncc As NhaCungCapDTO) As Boolean
        Dim kt As Boolean = True
        If ncc.TenNhaCungCap.Length = 0 Then
            Return False
        End If
        NhaCungCapDAO.ThemNhaCungCap(ncc)
        Return kt
    End Function

    Public Shared Function CapNhatNhaCungCap(ncc As NhaCungCapDTO) As Boolean
        Dim kt As Boolean = True
        If ncc.TenNhaCungCap.Length = 0 Then
            Return False
        End If
        NhaCungCapDAO.CapNhatNhaCungCap(ncc)
        Return kt
    End Function

    Public Shared Function XoaNhaCungCap(ncc As NhaCungCapDTO) As Boolean
        Dim kt As Boolean = True
        NhaCungCapDAO.XoaNhaCungCap(ncc)
        Return kt
    End Function

    Public Shared DongKetNoi As SqlClient.SqlConnection = CKetNoi.Connect
End Class
